#include <iostream>
#include <typeinfo>

//rtti : runtime type identification 运行时类型识别
//rtti : 在虚表的时候

// 重载和重写？
// 函数名
class Base1
{
public:
    virtual void show(){}
};

class Derived:public Base1
{
public:
    virtual void show(){}
};

class Derived2:public Base1
{};

int main()
{
    Base1 * b = new Derived;
    std::cout<<b<<std::endl;
    Derived * d = dynamic_cast<Derived*>(b);    //内部包含RTTI
    std::cout <<d<<std::endl;
    

    // //运行时多态
    // std::cout<<typeid(*b).name()<<std::endl;

//多态耗费内存，crtp
    return 0;
}